<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.eos.freeect.common.Globals" %>
<%@ page import="com.eos.freeect.common.model.Login" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title><%=Globals.SYSTEM_NAME%></title>

  <s:include value="/common/base.jsp"/>
  <base href="<%=request.getAttribute("basepath")%>"/>

  <link href="template/content.css" rel="stylesheet" type="text/css">
  <script language="javascript" src="js/common.js"></script>
  <script language="JavaScript">
    // this page should never load inside of another frame
    if (top.location != self.location) {
      top.location = self.location;
    }
  </script>
</head>

<body bgcolor="#39A8E0" onload="getMessage('${message}')">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" bgcolor="#39A8E0">
  <tr>
    <td>
        <table  border="0" cellpadding="0" cellspacing="0" width="55%" align="center">
          <tr>
            <td width="100%">
            <img border="0" src="images/login/login-top.jpg"></td>
          </tr>

          <tr>
            <td width="100%">
                <form action="common/login.eos" method="post" name="loginform" onsubmit="fnSubmitForm()">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
                        <tr>
                            <td><img border="0" src="images/login/login-middle-left.jpg" ></td>
                            <td>
                                <table border="0" cellpadding="0" cellspacing="5" width="100%">
                                   <tr>
                                       <td width="100%"><img border="0" src="images/login/login-middle-up.jpg"></td>
                                   </tr>
                                   <tr>
                                       <td align="center"><img border="0" src="images/login/login-middle-mid.jpg"></td>
                                   </tr>
                                   <tr>
                                       <td width="100%" background="images/login/login-middle-right.jpg">
                                          <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                             <tr>
                                                 <td height="20"></td>
                                             </tr>
                                             <tr>
                                                 <td width="25"></td>
                                                 <td nowrap width="54" height="33" class="login" >用户名:</td>
                                                 <td align="center">
                                                      <input name="username" size="15" maxlength="20" type="text" style="width:123px"/>
                                                 </td>
                                             </tr>
                                             <tr>
                                                 <td width="20"></td>
                                                 <td height="25" class="login">密码:</td>
                                                 <td align="center">
                                                       <input name="password" size="15" maxlength="20" type="password" style="width:123px" />
                                                 </td>
                                             </tr>
                                             <tr>
                                                 <td width="20"></td>
                                                 <td width="54"></td>
                                                 <td height="42" align="center" valign="middle">
                                                        <INPUT type="submit" class="button" value="提 交" />&nbsp;&nbsp;&nbsp;
														<INPUT type="reset" class="button" value="重 置">
                                                 </td>
                                              </tr>
                                              <tr>
                                                 <td height="0"></td>
                                              </tr>
                                             </table>
                                         </td>
                                      </tr>
                                   </table>
                              </td>
                           </tr>
                      </table>
                </form>
            </td>
          </tr>
          <tr>
            <td height="45" valign="top" bgcolor="#39A8E0"><font color="#FFFFFF">
              <%=Globals.SYSTEM_COPYRIGHT%>&nbsp;&nbsp;&lt;<a href="mailto:<%=Globals.SYSTEM_ADMIN_MAIL%>" class="login-contact">联系我们</a>&gt;<br>
              <%=Globals.SYSTEM_NAME%> (<%=Globals.SYSTEM_ALIAS%>)&nbsp;&nbsp;
              <%=Globals.SYSTEM_VERSION_TYPE%> 版本号: <%=Globals.SYSTEM_VERSION%></font>
            </td>
          </tr>
          <tr>
            <td height="100">
            </td>
          </tr>
        </table>
    </td>
  </tr>
</table>
</html>

<script language="JavaScript">
  function fnSubmitForm() {
    var haserror = false;

    if(document.forms["loginform"].username.value == "") {
      alert("您还没有输入用户名");
      document.forms["loginform"].username.focus();
      haserror = true;
    }
    else if(document.forms["loginform"].password.value == "") {
      alert("您还没有输入密码");
      document.forms["loginform"].password.focus();
      haserror = true;
    }

    if(haserror == false) {
      document.forms["loginform"].submit();
    }

    event.returnValue = false;
  }

  function fnOnEnter() {
    if(window.event.keyCode == 13) {
      fnSubmitForm();
    }
  }

  if(document.forms["loginform"].username.value == 0) {
    document.forms["loginform"].username.focus();
  }
  else {
    document.forms["loginform"].password.focus();
  }

  document.forms["loginform"].onkeydown=fnOnEnter;
</script>
